module tb_quadmux4to1;

	reg [3:0] InA;
	reg [3:0] InB;
	reg [3:0] InC;
	reg [3:0] InD;
	reg [1:0] S;
	wire [3:0] Out;

//Module instantiation:
	quadmux4_1 DUB(.InA(InA), .InB(InB),.InC(InC),.InD(InD), .S(S), .Out(Out));

	initial
	begin
	   InA = 4'b1010;
	   InB = 4'b0101;
	   InC = 4'b1100;
	   InD = 4'b0011;
	   S = 2'b11;

  	   #10 InD = 4'b0011;
           #10 S = 2'b01;
	   #10 InB = 4'b0111;
           #10 S = 2'b00;
	   #10 InA = 4'b1111;
	   #10 S=2'b10;
	   #10 InC = 4'b1110;
	   #10 $finish;
     end
     
   //Output monitors
     always@(S, InA, InB, InC, InD, Out)
	begin
        #5
	     case(S)
		2'b00 : $display("Expecting InA : %b, Got %b", InA, Out);
		2'b01 : $display("Expecting InB : %b, Got %b", InB, Out);
		2'b10 : $display("Expecting InC : %b, Got %b", InC, Out);
		2'b11 : $display("Expecting InD : %b, Got %b", InD, Out);
	     endcase
	end
endmodule
